Skip to content

Added strict option for RedirectPlugin not to modify request method… #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2021

Conversation

olexiyk
Copy link
Contributor

@olexiyk olexiyk commented Jul 2, 2021

… on statuses 300, 301, 302

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets fixes #207, partially #205
License MIT

What's in this PR?

Resolves #207 by allowing to follow redirect specs for 301 and 302 more strictly - not modifying request method

Example Usage

        $plugins = $plugins ?? [
            new RedirectPlugin(['strict' => true]),
        ];

        $httpClient = (new PluginClientFactory())->createClient(
            Psr18ClientDiscovery::find(),
            $plugins
        );

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pull request and the detailed explanation. this makes sense to me 👍

can you update https://github.com/php-http/documentation/blob/master/plugins/redirect.rst for the documentation please?

added more details on the change

Co-authored-by: David Buchmann <david@liip.ch>
Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again!

@dbu dbu merged commit c754501 into php-http:master Jul 3, 2021
@olexiyk olexiyk deleted the redirect-plugin-strict branch July 5, 2021 08:05
@dbu
Copy link
Contributor

dbu commented Jul 5, 2021

i tagged 2.4.0 with this feature. thanks for the contribution!

@olexiyk
Copy link
Contributor Author

olexiyk commented Jul 5, 2021

Thank you for quick action!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option for RedirectPlugin not to modify request on statuses 300, 301, 302
2 participants